import java.io.*;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        try(Reader reader = new FileReader("Hello World.txt")) {

            Scanner scanner = new Scanner(reader);
            String s = scanner.next();
            System.out.println(s);

        }catch(IOException E) {
            E.printStackTrace();
        }
    }
    public static void main1(String[] args) {
        try(InputStream inputStream = new FileInputStream("Hello World.txt")) {
            Scanner scanner = new Scanner(inputStream);
            String s = scanner.next();
            System.out.println(s);
        }catch(IOException e) {
            e.printStackTrace();
        }
    }
}
